package mysql

import (
	"aiserver/pkg/store"

	"gitee.com/wujianqiang/golibs/pkg/spice"
	"github.com/redis/go-redis/v9"

	"gorm.io/gorm"
)

type datastore struct {
	db  *gorm.DB
	rds *redis.Client
	spd *spice.SpiceSrv
}

func (ds *datastore) Users() store.UserStore {
	return newUsers(ds)
}

func (ds *datastore) Groups() store.GroupStore {
	return newGroups(ds)
}

func GetMysqlFactory(db *gorm.DB, rds *redis.Client, spd *spice.SpiceSrv) store.Factory {
	ds := &datastore{db, rds, spd}
	return ds
}
